<template>
	<view class="">
		<!-- 文章列表 -->
		<view @click="to_detail(item.id)" style="height: 100upx;background-color: #fff;line-height: 100upx;margin: 30upx 0upx;display: flex;" v-for="(item,index) in res" :key="index">
			<image :src="item.real_head_img" style="width: 100upx;height: 100upx;" mode=""></image>
			<text style="margin: 0upx 160upx 0upx 30upx;">{{item.title}}</text>
			<view>{{item.user_name}}</view><view>{{item.content}}</view>
		</view>
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				res:[],
				user_id:'',
				article_id: '',
				
			};
		},
		onLoad:function(e){
			this.article_id = e.article
			uni.showLoading()
			uni.getStorage({
				key: 'user_id',
				success: (res) => {
					this.user_id = res.data
					this.setAjax()
				},
				fail: () => {
					uni.navigateTo({
						url: '../../../index/index'
					});
				}
			});
		},
		methods:{
			setAjax(){
				// 文章列表
				uni.request({
					url: 'https://cx.mingmeijt.com/Api/LabelPaper/index',
					method: 'POST',
					header:{'Content-Type':'application/x-www-form-urlencoded'},
					data:{
						user_id: this.user_id,
						status: 3,
						id: this.article_id,
					},
					success: res => {
					this.res = res.data.data.list
					console.log(this.res)
					},
					fail: () => {},
					complete: () => {}
				});
				uni.hideLoading()
			},
			jump(e){
				uni.navigateTo({
					url: e.currentTarget.dataset.src
				});
			},
			to_detail(id){
				uni.navigateTo({
					url:'/pagesA/user/shequ/wenzhang/wenzhang?articleid=' + id
				})
			}
		}
	}
</script>

<style>
	page{background-color: #F8F8F8;}
</style>
